package main

import "fmt"

func arrayDemo() {
	var a [3]int
	var b [4]int
	fmt.Printf("%T\n%T\n", a, b)
	var c = [...]int{1, 2, 3}
	var d = [...]int{3, 4, 5, 6}
	fmt.Printf("%T\n%T\n", c, d)
	fmt.Printf("%d\n", len(c))
	var e = c
	e[1] = 1
	fmt.Printf("%d，%d", c[1], e[1])
}
func main() {
	//arrayDemo()
	//sumArray()
	findSumIndex()
}
func sumArray() {
	var a = [...]int{1, 3, 5, 7, 8}
	var b = 1
	for _, v := range a {
		b *= v
	}
	fmt.Printf("%d", b)
}
func findSumIndex() {
	var arr = [...]int{1, 3, 5, 7, 8, 4}
	var s = 8
	for i := 0; i < len(arr); i++ {
		for j := 0; j < i; j++ {
			if arr[i]+arr[j] == s {
				fmt.Printf("%d,%d\n", i, j)
			}
		}
	}
}
